package cn.edu.controller;

import cn.edu.vo.ResultVO;
import com.alibaba.fastjson.JSON;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Mr.ma
 * @since 2023/1/3 20:47
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("insert")
    @PreAuthorize(value = "hasAuthority('user:insert')")
    public String insert(){
        return JSON.toJSONString(new ResultVO(2000, "添加用户信息", null));
    }

    @RequestMapping("delete")
    @PreAuthorize(value = "hasAuthority('user:delete')")
    public String delete(){
        return JSON.toJSONString(new ResultVO(2000, "删除用户信息", null));
    }

    @RequestMapping("update")
    @PreAuthorize(value = "hasAuthority('user:update')")
    public String update(){
        return JSON.toJSONString(new ResultVO(2000, "修改用户信息", null));
    }

    @RequestMapping("query")
    @PreAuthorize(value = "hasAuthority('user:query')")
    public String query(){
        return JSON.toJSONString(new ResultVO(2000, "查询用户信息", null));
    }

    @RequestMapping("export")
    @PreAuthorize(value = "hasAuthority('user:export')")
    public String export(){
        return JSON.toJSONString(new ResultVO(2000, "导出用户信息", null));
    }
}
